package utils.windowCatch;

import utils.command.CommandLinux;

import java.io.IOException;

public class WindowCatch {
    public static String getSelectWindow() throws IOException {
        String[] args = new String[]{"/bin/bash", "-c", "xdotool getactivewindow"};
        String output = CommandLinux.oSCommandStatic(args).replace("\n","");
        System.out.println("catch過程輸出" + output);
        if(output.split(" ").length > 1)
            return null;
        return changTo0x(output);
    }
    public static String changTo0x(String Id) {
        return "0x"+ Integer.toHexString(Integer.parseInt(Id));
    }
}
